package beans;

import entities.Pacchetto;
import controllers.PacchettoFacade;
import java.io.Serializable;
import java.util.ResourceBundle;
import javax.annotation.PostConstruct;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import javax.inject.Inject;
import javax.faces.view.ViewScoped;

@Named(value = "pacchettoController")
@ViewScoped
public class PacchettoController extends AbstractController<Pacchetto> implements Serializable {

    @Inject
    private PacchettoFacade ejbFacade;

    public PacchettoController() {
        super(Pacchetto.class);
    }

    @PostConstruct
    public void init() {
        super.setFacade(ejbFacade);
    }

    public String url(){
        return "/admin/manageElements?faces-redirect=true&idViaggio=" + selected.getIdPACCHETTO();
    }
    
     @Override
     public void saveNew(ActionEvent event) {
        super.selected.setIdPACCHETTO(Integer.MAX_VALUE);
        super.saveNew(event);
    }

}
